package com.iflytek.uoamp.notify.core.action;

import com.iflytek.uoamp.common.notify.exception.NotifyException;
import com.iflytek.uoamp.common.notify.obj.Notification;
import com.iflytek.uoamp.notify.core.protocol.DirectNotification;

public class ImmediateNotifyAction extends AbstractNotifyAction{

    @Override
    public boolean doTask(Notification item) {
    	DirectNotification notification = (DirectNotification)item;
    	
        long currentTime = System.currentTimeMillis();
        
        try {
            return Dispatcher.getInstance(logInfo).dispatch(notification, currentTime);
        } catch (NotifyException e) {
            logInfo.addError(e.getMessage());
            return false;
        }
    }
}
